<%@ include file="/common/taglibs.jsp"%>
<%@ taglib prefix="search" tagdir="/WEB-INF/tags/search"%>
<probiz:pageHeading pageHeadingKey="mailQueueList.heading" />

<content tag="buttons">
	<probiz:iconBtn btnType="delete" onclick="return fnDoMultiDelete(this);" />
</content>

<search:searchBox formAction="${ctxPath}/tool/mailQueue.html">
	<div class="basic_search">
		<search:basicSearch attrPath="s.mailSubject" attrNameKey="mailQueue.mailSubject" datatype="String"
			operator="LIKE" classes="inputtxt" labelWidth="80px" />
	</div>
	<div class="more_search">
		<table border="0" cellspacing="0" cellpadding="0" class="search_table">
			<c:set var="attrName">COL@s.sendStatus@Short@EQ</c:set>
			<c:set var="selectedSendStatus" value="${sc==null?requestScope[attrName]:sc.param[attrName]}"/>
			<tr>
				<th width="80px"><label for="${attrName}"><fmt:message key="mailQueue.sendStatus"/><fmt:message key="common.message.colon"/></label></th>
				<td>
					
					<select id="${attrName}" name="${attrName}" value="${sc==null?requestScope[attrName]:sc.param[attrName]}" class="selecttxt" style="width:150px">
						<option value=""><fmt:message key="status.all"/></option>
						<option value="0"><fmt:message key="mailQueue.sendStatus0"/></option>
						<option value="2"><fmt:message key="mailQueue.sendStatus2"/></option>
						<option value="9"><fmt:message key="mailQueue.sendStatus9"/></option>
					</select>
				</td>
			</tr>
		</table>
	</div>
</search:searchBox>
<form class="mainForm" name="mailQueueListForm" method="post">
	<div class="data">
	<div class="top clearfix">
		<ul class="tab">
			<li class="curr"><span><fmt:message key="menu.mailQueue"/></span></li>
		</ul>
		<%@include file="/common/pagingOnlyTop.jsp"%>
	</div>
	
		<c:set var="checkAll"><input type="checkbox" name="allbox" onclick="checkAll(this.form)" style="margin: 0 0 0 0px" /></c:set>
		<display:table name="${mailQueueList}" cellspacing="0" cellpadding="0" uid="mailQueueItem"
			class="list_table" export="false" requestURI="">
			<display:column style="width: 2%; padding-top:5px " title="${checkAll}" media="html" >
				<input type="checkbox" name="multiIds" value="${mailQueueItem.mailQueueId}" title="${mailQueueItem.mailSubject}"/>
			</display:column>
			<display:column style="width: 20%" sortable="true" paramId="mailQueueId" paramProperty="mailQueueId"
				decorator="com.probiz.estore.core.decorator.TblColumnDecorator" titleKey="mailQueue.mailSubject">
				${mailQueueItem.mailSubject}
			</display:column>
		    <display:column style="width: 10%" property="mailFrom" sortable="true" headerClass="data-table-title"
        		decorator="com.probiz.estore.core.decorator.TblColumnDecorator" titleKey="mailQueue.mailFrom"/>
		    <display:column sortable="true" headerClass="data-table-title"
        		decorator="com.probiz.estore.core.decorator.TblColumnDecorator" titleKey="mailQueue.mailTos">
        		<c:set value='${fn:split(mailQueueItem.mailTos,",")}'  var="mailToList"/>
        		<c:forEach items="${mailToList}" var="mailTo">
        			${mailTo} <br/>
        		</c:forEach>
        	</display:column>	
		    <display:column style="width: 6%" sortable="true" headerClass="data-table-title"
        		decorator="com.probiz.estore.core.decorator.TblColumnDecorator" titleKey="mailQueue.sendStatus">
        		<fmt:message key="mailQueue.sendStatus${mailQueueItem.sendStatus}"/>
        	</display:column>
		    <display:column style="width: 6%" property="sendTimes" sortable="true" headerClass="data-table-title"
        		decorator="com.probiz.estore.core.decorator.TblColumnDecorator" titleKey="mailQueue.sendTimes"/>
		    <display:column style="width: 30%" property="errorMsg" sortable="false" headerClass="data-table-title"
        		decorator="com.probiz.estore.core.decorator.TblColumnDecorator" titleKey="mailQueue.errorMsg"/>
		</display:table>
		<%@include file="/common/pagingOnly.jsp"%>
	</div>
</form>
<script type="text/javascript">
$j(document).ready(function(){
	highlightTableRows("mailQueueItem");
	document.forms["searchForm"].elements["${attrName}"].value="${selectedSendStatus}";
});
</script>